<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="页面唯一ID" prop="uniqueId">
        <el-input
          v-model="queryParams.uniqueId"
          placeholder="请输入页面唯一ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应用唯一ID" prop="serUniqueId">
        <el-input
          v-model="queryParams.serUniqueId"
          placeholder="请输入应用唯一ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="表单唯一ID" prop="depUniqueId">
        <el-input
          v-model="queryParams.depUniqueId"
          placeholder="请输入表单唯一ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建人ID" prop="clientId">
        <el-input
          v-model="queryParams.clientId"
          placeholder="请输入创建人ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="当前版本唯一id" prop="currVersionUniqueId">
        <el-input
          v-model="queryParams.currVersionUniqueId"
          placeholder="请输入当前版本唯一id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="中文名称" prop="cname">
        <el-input
          v-model="queryParams.cname"
          placeholder="请输入中文名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="英文名称" prop="ename">
        <el-input
          v-model="queryParams.ename"
          placeholder="请输入英文名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品的页面资源路径" prop="resource">
        <el-input
          v-model="queryParams.resource"
          placeholder="请输入产品的页面资源路径"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="iconURL" prop="picUrl">
        <el-input
          v-model="queryParams.picUrl"
          placeholder="请输入iconURL"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="选中得icon" prop="ckdPicUrl">
        <el-input
          v-model="queryParams.ckdPicUrl"
          placeholder="请输入选中得icon"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建人" prop="createNickName">
        <el-input
          v-model="queryParams.createNickName"
          placeholder="请输入创建人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="更新人" prop="updateNickName">
        <el-input
          v-model="queryParams.updateNickName"
          placeholder="请输入更新人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品描述" prop="description">
        <el-input
          v-model="queryParams.description"
          placeholder="请输入产品描述"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品拓展" prop="ext">
        <el-input
          v-model="queryParams.ext"
          placeholder="请输入产品拓展"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="逻辑删除 
1正常 
0删除" prop="deleteFlag">
        <el-input
          v-model="queryParams.deleteFlag"
          placeholder="请输入逻辑删除 
1正常 
0删除"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="调用次数阈值" prop="callCountThreshold">
        <el-input
          v-model="queryParams.callCountThreshold"
          placeholder="请输入调用次数阈值"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="依赖方数阈值" prop="callerCountThreshold">
        <el-input
          v-model="queryParams.callerCountThreshold"
          placeholder="请输入依赖方数阈值"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="帮助文档url" prop="assistUrl">
        <el-input
          v-model="queryParams.assistUrl"
          placeholder="请输入帮助文档url"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="Paas服务回调url" prop="callbackUrl">
        <el-input
          v-model="queryParams.callbackUrl"
          placeholder="请输入Paas服务回调url"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="序号，用于排序，数字越小越靠前" prop="sort">
        <el-input
          v-model="queryParams.sort"
          placeholder="请输入序号，用于排序，数字越小越靠前"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否为门户应用
1是门户应用
2不是门户应用
默认为2，不是门户应用" prop="portalApplicationFlag">
        <el-input
          v-model="queryParams.portalApplicationFlag"
          placeholder="请输入是否为门户应用
1是门户应用
2不是门户应用
默认为2，不是门户应用"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="问卷网址" prop="questionnaireUrl">
        <el-input
          v-model="queryParams.questionnaireUrl"
          placeholder="请输入问卷网址"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品联系人" prop="appContacts">
        <el-input
          v-model="queryParams.appContacts"
          placeholder="请输入产品联系人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="组件唯一id" prop="cmptUniqueId">
        <el-input
          v-model="queryParams.cmptUniqueId"
          placeholder="请输入组件唯一id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="源代码url" prop="sourceCode">
        <el-input
          v-model="queryParams.sourceCode"
          placeholder="请输入源代码url"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="sdk示例url" prop="sample">
        <el-input
          v-model="queryParams.sample"
          placeholder="请输入sdk示例url"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否为管理员专属" prop="adminExclusive">
        <el-input
          v-model="queryParams.adminExclusive"
          placeholder="请输入是否为管理员专属"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="空间唯一id" prop="spaceUniqueId">
        <el-input
          v-model="queryParams.spaceUniqueId"
          placeholder="请输入空间唯一id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="空间名称" prop="spaceName">
        <el-input
          v-model="queryParams.spaceName"
          placeholder="请输入空间名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品版本，version &gt;= 1.0 的产品的 产品标签不会出现在网关 请求头中。" prop="version">
        <el-input
          v-model="queryParams.version"
          placeholder="请输入产品版本，version &gt;= 1.0 的产品的 产品标签不会出现在网关 请求头中。"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="可见范围" prop="avaiLableRange">
        <el-input
          v-model="queryParams.avaiLableRange"
          placeholder="请输入可见范围"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导航菜单配置-方向 0 左边 1 顶部" prop="navigateDirection">
        <el-input
          v-model="queryParams.navigateDirection"
          placeholder="请输入导航菜单配置-方向 0 左边 1 顶部"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应用访问权限开关 1启用 2关闭" prop="prodPermissStatu">
        <el-input
          v-model="queryParams.prodPermissStatu"
          placeholder="请输入应用访问权限开关 1启用 2关闭"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['product:info:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['product:info:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['product:info:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['product:info:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="自增ID" align="center" prop="id" />
      <el-table-column label="页面唯一ID" align="center" prop="uniqueId" />
      <el-table-column label="应用唯一ID" align="center" prop="serUniqueId" />
      <el-table-column label="表单唯一ID" align="center" prop="depUniqueId" />
      <el-table-column label="创建人ID" align="center" prop="clientId" />
      <el-table-column label="创建人" align="center" prop="appType" />
      <el-table-column label="当前版本唯一id" align="center" prop="currVersionUniqueId" />
      <el-table-column label="类型" align="center" prop="type" />
      <el-table-column label="中文名称" align="center" prop="cname" />
      <el-table-column label="英文名称" align="center" prop="ename" />
      <el-table-column label="产品的页面资源路径" align="center" prop="resource" />
      <el-table-column label="iconURL" align="center" prop="picUrl" />
      <el-table-column label="选中得icon" align="center" prop="ckdPicUrl" />
      <el-table-column label="创建人" align="center" prop="createNickName" />
      <el-table-column label="更新人" align="center" prop="updateNickName" />
      <el-table-column label="1启用
2禁用" align="center" prop="status" />
      <el-table-column label="产品描述" align="center" prop="description" />
      <el-table-column label="产品拓展" align="center" prop="ext" />
      <el-table-column label="逻辑删除 
1正常 
0删除" align="center" prop="deleteFlag" />
      <el-table-column label="调用次数阈值" align="center" prop="callCountThreshold" />
      <el-table-column label="依赖方数阈值" align="center" prop="callerCountThreshold" />
      <el-table-column label="帮助文档url" align="center" prop="assistUrl" />
      <el-table-column label="Paas服务回调url" align="center" prop="callbackUrl" />
      <el-table-column label="序号，用于排序，数字越小越靠前" align="center" prop="sort" />
      <el-table-column label="是否为门户应用
1是门户应用
2不是门户应用
默认为2，不是门户应用" align="center" prop="portalApplicationFlag" />
      <el-table-column label="问卷网址" align="center" prop="questionnaireUrl" />
      <el-table-column label="产品联系人" align="center" prop="appContacts" />
      <el-table-column label="组件唯一id" align="center" prop="cmptUniqueId" />
      <el-table-column label="源代码url" align="center" prop="sourceCode" />
      <el-table-column label="sdk示例url" align="center" prop="sample" />
      <el-table-column label="是否为管理员专属" align="center" prop="adminExclusive" />
      <el-table-column label="空间唯一id" align="center" prop="spaceUniqueId" />
      <el-table-column label="空间名称" align="center" prop="spaceName" />
      <el-table-column label="产品版本，version &gt;= 1.0 的产品的 产品标签不会出现在网关 请求头中。" align="center" prop="version" />
      <el-table-column label="可见范围" align="center" prop="avaiLableRange" />
      <el-table-column label="导航菜单配置-方向 0 左边 1 顶部" align="center" prop="navigateDirection" />
      <el-table-column label="应用访问权限开关 1启用 2关闭" align="center" prop="prodPermissStatu" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['product:info:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['product:info:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改产品对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="页面唯一ID" prop="uniqueId">
          <el-input v-model="form.uniqueId" placeholder="请输入页面唯一ID" />
        </el-form-item>
        <el-form-item label="应用唯一ID" prop="serUniqueId">
          <el-input v-model="form.serUniqueId" placeholder="请输入应用唯一ID" />
        </el-form-item>
        <el-form-item label="表单唯一ID" prop="depUniqueId">
          <el-input v-model="form.depUniqueId" placeholder="请输入表单唯一ID" />
        </el-form-item>
        <el-form-item label="创建人ID" prop="clientId">
          <el-input v-model="form.clientId" placeholder="请输入创建人ID" />
        </el-form-item>
        <el-form-item label="当前版本唯一id" prop="currVersionUniqueId">
          <el-input v-model="form.currVersionUniqueId" placeholder="请输入当前版本唯一id" />
        </el-form-item>
        <el-form-item label="中文名称" prop="cname">
          <el-input v-model="form.cname" placeholder="请输入中文名称" />
        </el-form-item>
        <el-form-item label="英文名称" prop="ename">
          <el-input v-model="form.ename" placeholder="请输入英文名称" />
        </el-form-item>
        <el-form-item label="产品的页面资源路径" prop="resource">
          <el-input v-model="form.resource" placeholder="请输入产品的页面资源路径" />
        </el-form-item>
        <el-form-item label="iconURL" prop="picUrl">
          <el-input v-model="form.picUrl" placeholder="请输入iconURL" />
        </el-form-item>
        <el-form-item label="选中得icon" prop="ckdPicUrl">
          <el-input v-model="form.ckdPicUrl" placeholder="请输入选中得icon" />
        </el-form-item>
        <el-form-item label="创建人" prop="createNickName">
          <el-input v-model="form.createNickName" placeholder="请输入创建人" />
        </el-form-item>
        <el-form-item label="更新人" prop="updateNickName">
          <el-input v-model="form.updateNickName" placeholder="请输入更新人" />
        </el-form-item>
        <el-form-item label="产品描述" prop="description">
          <el-input v-model="form.description" placeholder="请输入产品描述" />
        </el-form-item>
        <el-form-item label="产品拓展" prop="ext">
          <el-input v-model="form.ext" placeholder="请输入产品拓展" />
        </el-form-item>
        <el-form-item label="逻辑删除 
1正常 
0删除" prop="deleteFlag">
          <el-input v-model="form.deleteFlag" placeholder="请输入逻辑删除 
1正常 
0删除" />
        </el-form-item>
        <el-form-item label="调用次数阈值" prop="callCountThreshold">
          <el-input v-model="form.callCountThreshold" placeholder="请输入调用次数阈值" />
        </el-form-item>
        <el-form-item label="依赖方数阈值" prop="callerCountThreshold">
          <el-input v-model="form.callerCountThreshold" placeholder="请输入依赖方数阈值" />
        </el-form-item>
        <el-form-item label="帮助文档url" prop="assistUrl">
          <el-input v-model="form.assistUrl" placeholder="请输入帮助文档url" />
        </el-form-item>
        <el-form-item label="Paas服务回调url" prop="callbackUrl">
          <el-input v-model="form.callbackUrl" placeholder="请输入Paas服务回调url" />
        </el-form-item>
        <el-form-item label="序号，用于排序，数字越小越靠前" prop="sort">
          <el-input v-model="form.sort" placeholder="请输入序号，用于排序，数字越小越靠前" />
        </el-form-item>
        <el-form-item label="是否为门户应用
1是门户应用
2不是门户应用
默认为2，不是门户应用" prop="portalApplicationFlag">
          <el-input v-model="form.portalApplicationFlag" placeholder="请输入是否为门户应用
1是门户应用
2不是门户应用
默认为2，不是门户应用" />
        </el-form-item>
        <el-form-item label="问卷网址" prop="questionnaireUrl">
          <el-input v-model="form.questionnaireUrl" placeholder="请输入问卷网址" />
        </el-form-item>
        <el-form-item label="产品联系人" prop="appContacts">
          <el-input v-model="form.appContacts" placeholder="请输入产品联系人" />
        </el-form-item>
        <el-form-item label="组件唯一id" prop="cmptUniqueId">
          <el-input v-model="form.cmptUniqueId" placeholder="请输入组件唯一id" />
        </el-form-item>
        <el-form-item label="源代码url" prop="sourceCode">
          <el-input v-model="form.sourceCode" placeholder="请输入源代码url" />
        </el-form-item>
        <el-form-item label="sdk示例url" prop="sample">
          <el-input v-model="form.sample" placeholder="请输入sdk示例url" />
        </el-form-item>
        <el-form-item label="是否为管理员专属" prop="adminExclusive">
          <el-input v-model="form.adminExclusive" placeholder="请输入是否为管理员专属" />
        </el-form-item>
        <el-form-item label="空间唯一id" prop="spaceUniqueId">
          <el-input v-model="form.spaceUniqueId" placeholder="请输入空间唯一id" />
        </el-form-item>
        <el-form-item label="空间名称" prop="spaceName">
          <el-input v-model="form.spaceName" placeholder="请输入空间名称" />
        </el-form-item>
        <el-form-item label="产品版本，version &gt;= 1.0 的产品的 产品标签不会出现在网关 请求头中。" prop="version">
          <el-input v-model="form.version" placeholder="请输入产品版本，version &gt;= 1.0 的产品的 产品标签不会出现在网关 请求头中。" />
        </el-form-item>
        <el-form-item label="可见范围" prop="avaiLableRange">
          <el-input v-model="form.avaiLableRange" placeholder="请输入可见范围" />
        </el-form-item>
        <el-form-item label="导航菜单配置-方向 0 左边 1 顶部" prop="navigateDirection">
          <el-input v-model="form.navigateDirection" placeholder="请输入导航菜单配置-方向 0 左边 1 顶部" />
        </el-form-item>
        <el-form-item label="应用访问权限开关 1启用 2关闭" prop="prodPermissStatu">
          <el-input v-model="form.prodPermissStatu" placeholder="请输入应用访问权限开关 1启用 2关闭" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/product/info"

export default {
  name: "Info",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 产品表格数据
      infoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        uniqueId: null,
        serUniqueId: null,
        depUniqueId: null,
        clientId: null,
        appType: null,
        currVersionUniqueId: null,
        type: null,
        cname: null,
        ename: null,
        resource: null,
        picUrl: null,
        ckdPicUrl: null,
        createNickName: null,
        updateNickName: null,
        status: null,
        description: null,
        ext: null,
        deleteFlag: null,
        callCountThreshold: null,
        callerCountThreshold: null,
        assistUrl: null,
        callbackUrl: null,
        sort: null,
        portalApplicationFlag: null,
        questionnaireUrl: null,
        appContacts: null,
        cmptUniqueId: null,
        sourceCode: null,
        sample: null,
        adminExclusive: null,
        spaceUniqueId: null,
        spaceName: null,
        version: null,
        avaiLableRange: null,
        navigateDirection: null,
        prodPermissStatu: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        uniqueId: [
          { required: true, message: "页面唯一ID不能为空", trigger: "blur" }
        ],
        navigateDirection: [
          { required: true, message: "导航菜单配置-方向 0 左边 1 顶部不能为空", trigger: "blur" }
        ],
        prodPermissStatu: [
          { required: true, message: "应用访问权限开关 1启用 2关闭不能为空", trigger: "blur" }
        ]
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {
    /** 查询产品列表 */
    getList() {
      this.loading = true
      listInfo(this.queryParams).then(response => {
        this.infoList = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        uniqueId: null,
        serUniqueId: null,
        depUniqueId: null,
        clientId: null,
        appType: null,
        currVersionUniqueId: null,
        type: null,
        cname: null,
        ename: null,
        resource: null,
        picUrl: null,
        ckdPicUrl: null,
        createBy: null,
        createNickName: null,
        createTime: null,
        updateNickName: null,
        updateBy: null,
        updateTime: null,
        status: null,
        description: null,
        ext: null,
        deleteFlag: null,
        callCountThreshold: null,
        callerCountThreshold: null,
        assistUrl: null,
        callbackUrl: null,
        sort: null,
        portalApplicationFlag: null,
        questionnaireUrl: null,
        appContacts: null,
        cmptUniqueId: null,
        sourceCode: null,
        sample: null,
        adminExclusive: null,
        spaceUniqueId: null,
        spaceName: null,
        version: null,
        avaiLableRange: null,
        navigateDirection: null,
        prodPermissStatu: null
      }
      this.resetForm("form")
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm")
      this.handleQuery()
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset()
      this.open = true
      this.title = "添加产品"
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset()
      const id = row.id || this.ids
      getInfo(id).then(response => {
        this.form = response.data
        this.open = true
        this.title = "修改产品"
      })
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功")
              this.open = false
              this.getList()
            })
          } else {
            addInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功")
              this.open = false
              this.getList()
            })
          }
        }
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids
      this.$modal.confirm('是否确认删除产品编号为"' + ids + '"的数据项？').then(function() {
        return delInfo(ids)
      }).then(() => {
        this.getList()
        this.$modal.msgSuccess("删除成功")
      }).catch(() => {})
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('product/info/export', {
        ...this.queryParams
      }, `info_${new Date().getTime()}.xlsx`)
    }
  }
}
</script>
